﻿package rd.hardcore.selector 
{
	import adobe.utils.CustomActions;
	import flash.display.SpreadMethod;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import rd.hardcore.Datas;
	/**
	 * Affichage et gestion de la liste de mp3
	 * @author Thibault Perret
	 */
	public class SelectList extends Sprite
	{
		
		/*	V A R	*/
		static public var HEIGHT	: int;
		
		private var cpt				: int = 0;
		private var tabItem			: Array	=	[];
		private var datas			: XML;
		
		
		public function SelectList() 
		{
			/*	D A T A S	*/
			datas = Datas.datas;
			trace(datas.tracks);
			
			/*	position	*/
			
			for each(var node : XML in datas.tracks.children() )
			{
				trace(node);
				
				var item	:	SelectItem_Fc	=	new SelectItem_Fc();
				item.label = node.toString();
				item.mediaPath = node.@file.toString();
				
				item.y = item.height * cpt;
				addChild(item);
				tabItem.push(item);
				cpt++;
			}
			
			HEIGHT = (1 + cpt) * item.height + 26;
			if (HEIGHT	>	250)	HEIGHT	=	250;
		}
		
	}

}